package com.lx.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;


//等价于  <bean id="user" class="com.lx.pojo.User"></bean>
//component 组件
@Component

/** 等价于
 * <bean id="user" class="com.lx.pojo.User" scope="singleton">
 *   <property name="name" value="lxasdf"></property>
 * </bean>
 */
@Scope("singleton")
public class User {
    /**
     * 等价于
     *     <bean id="user" class="com.lx.pojo.User">
     *         <property name="name" value="asdf"></property>
     *     </bean>
     */
    @Value("asdf")
    public String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
